using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._DataManagementTools._Raster._RasterProcessing
{
    /// <summary>
    /// <para>Resample</para>
    /// <para>Changes the spatial resolution of a raster dataset and sets rules for aggregating or interpolating values across the new pixel sizes.</para>
    /// <para>更改栅格数据集的空间分辨率，并设置用于跨新像素大小聚合或插值值的规则。</para>
    /// </summary>    
    [DisplayName("Resample")]
    public class Resample : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public Resample()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_raster">
        /// <para>Input Raster</para>
        /// <para>The raster dataset with the spatial resolution to be changed.</para>
        /// <para>具有要更改的空间分辨率的栅格数据集。</para>
        /// </param>
        /// <param name="_out_raster">
        /// <para>Output Raster Dataset</para>
        /// <para><xdoc>
        ///   <para>The name, location, and format of the dataset being created.</para>
        ///   <bulletList>
        ///     <bullet_item>.bil—Esri BIL</bullet_item><para/>
        ///     <bullet_item>.bip—Esri BIP</bullet_item><para/>
        ///     <bullet_item>.bmp—BMP</bullet_item><para/>
        ///     <bullet_item>.bsq—Esri BSQ</bullet_item><para/>
        ///     <bullet_item>.dat—ENVI DAT</bullet_item><para/>
        ///     <bullet_item>.gif—GIF</bullet_item><para/>
        ///     <bullet_item>.img—ERDAS IMAGINE</bullet_item><para/>
        ///     <bullet_item>.jpg—JPEG</bullet_item><para/>
        ///     <bullet_item>.jp2—JPEG 2000</bullet_item><para/>
        ///     <bullet_item>.png—PNG</bullet_item><para/>
        ///     <bullet_item>.tif—TIFF</bullet_item><para/>
        ///     <bullet_item>.mrf—MRF</bullet_item><para/>
        ///     <bullet_item>.crf—CRF</bullet_item><para/>
        ///     <bullet_item>No extension for Esri Grid</bullet_item><para/>
        ///   </bulletList>
        ///   <para>When storing a raster dataset in a geodatabase, do not add a file extension to the name of the raster dataset. When storing a raster dataset to JPEG, JPEG 2000, or TIFF format, or in a geodatabase, you can specify a compression type and compression quality.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>要创建的数据集的名称、位置和格式。</para>
        ///   <bulletList>
        ///     <bullet_item>.bil - Esri BIL</bullet_item><para/>
        ///     <bullet_item>.bip - Esri BIP</bullet_item><para/>
        ///     <bullet_item>.bmp—BMP</bullet_item><para/>
        ///     <bullet_item>.bsq—Esri BSQ</bullet_item><para/>
        ///     <bullet_item>.dat—ENVI DAT</bullet_item><para/>
        ///     <bullet_item>.gif—GIF</bullet_item><para/>
        ///     <bullet_item>.img—ERDAS 想象</bullet_item><para/>
        ///     <bullet_item>.jpg - JPEG</bullet_item><para/>
        ///     <bullet_item>.jp2 - JPEG 2000</bullet_item><para/>
        ///     <bullet_item>.png—PNG</bullet_item><para/>
        ///     <bullet_item>.tif—TIFF</bullet_item><para/>
        ///     <bullet_item>.mrf - MRF</bullet_item><para/>
        ///     <bullet_item>.crf - CRF</bullet_item><para/>
        ///     <bullet_item>没有 Esri Grid 的扩展模块</bullet_item><para/>
        ///   </bulletList>
        ///   <para>在地理数据库中存储栅格数据集时，请勿在栅格数据集的名称中添加文件扩展名。将栅格数据集存储为 JPEG、JPEG 2000 或 TIFF 格式或在地理数据库中时，可以指定压缩类型和压缩质量。</para>
        /// </xdoc></para>
        /// </param>
        public Resample(object _in_raster, object _out_raster)
        {
            this._in_raster = _in_raster;
            this._out_raster = _out_raster;
        }
        public override string ToolboxName => "Data Management Tools";

        public override string ToolName => "Resample";

        public override string CallName => "management.Resample";

        public override List<string> AcceptEnvironments => ["compression", "configKeyword", "extent", "geographicTransformations", "nodata", "outputCoordinateSystem", "parallelProcessingFactor", "pyramid", "rasterStatistics", "resamplingMethod", "scratchWorkspace", "snapRaster", "tileSize", "workspace"];

        public override object[] ParameterInfo => [_in_raster, _out_raster, _cell_size, _resampling_type.GetGPValue()];

        /// <summary>
        /// <para>Input Raster</para>
        /// <para>The raster dataset with the spatial resolution to be changed.</para>
        /// <para>具有要更改的空间分辨率的栅格数据集。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_raster { get; set; }


        /// <summary>
        /// <para>Output Raster Dataset</para>
        /// <para><xdoc>
        ///   <para>The name, location, and format of the dataset being created.</para>
        ///   <bulletList>
        ///     <bullet_item>.bil—Esri BIL</bullet_item><para/>
        ///     <bullet_item>.bip—Esri BIP</bullet_item><para/>
        ///     <bullet_item>.bmp—BMP</bullet_item><para/>
        ///     <bullet_item>.bsq—Esri BSQ</bullet_item><para/>
        ///     <bullet_item>.dat—ENVI DAT</bullet_item><para/>
        ///     <bullet_item>.gif—GIF</bullet_item><para/>
        ///     <bullet_item>.img—ERDAS IMAGINE</bullet_item><para/>
        ///     <bullet_item>.jpg—JPEG</bullet_item><para/>
        ///     <bullet_item>.jp2—JPEG 2000</bullet_item><para/>
        ///     <bullet_item>.png—PNG</bullet_item><para/>
        ///     <bullet_item>.tif—TIFF</bullet_item><para/>
        ///     <bullet_item>.mrf—MRF</bullet_item><para/>
        ///     <bullet_item>.crf—CRF</bullet_item><para/>
        ///     <bullet_item>No extension for Esri Grid</bullet_item><para/>
        ///   </bulletList>
        ///   <para>When storing a raster dataset in a geodatabase, do not add a file extension to the name of the raster dataset. When storing a raster dataset to JPEG, JPEG 2000, or TIFF format, or in a geodatabase, you can specify a compression type and compression quality.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>要创建的数据集的名称、位置和格式。</para>
        ///   <bulletList>
        ///     <bullet_item>.bil - Esri BIL</bullet_item><para/>
        ///     <bullet_item>.bip - Esri BIP</bullet_item><para/>
        ///     <bullet_item>.bmp—BMP</bullet_item><para/>
        ///     <bullet_item>.bsq—Esri BSQ</bullet_item><para/>
        ///     <bullet_item>.dat—ENVI DAT</bullet_item><para/>
        ///     <bullet_item>.gif—GIF</bullet_item><para/>
        ///     <bullet_item>.img—ERDAS 想象</bullet_item><para/>
        ///     <bullet_item>.jpg - JPEG</bullet_item><para/>
        ///     <bullet_item>.jp2 - JPEG 2000</bullet_item><para/>
        ///     <bullet_item>.png—PNG</bullet_item><para/>
        ///     <bullet_item>.tif—TIFF</bullet_item><para/>
        ///     <bullet_item>.mrf - MRF</bullet_item><para/>
        ///     <bullet_item>.crf - CRF</bullet_item><para/>
        ///     <bullet_item>没有 Esri Grid 的扩展模块</bullet_item><para/>
        ///   </bulletList>
        ///   <para>在地理数据库中存储栅格数据集时，请勿在栅格数据集的名称中添加文件扩展名。将栅格数据集存储为 JPEG、JPEG 2000 或 TIFF 格式或在地理数据库中时，可以指定压缩类型和压缩质量。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Raster Dataset")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_raster { get; set; }


        /// <summary>
        /// <para>Output Cell Size</para>
        /// <para>The cell size of the new raster using an existing raster dataset or by specifying its width (x) and height (y).</para>
        /// <para>使用现有栅格数据集或通过指定新栅格的宽度 （x） 和高度 （y） 来计算新栅格的像元大小。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Cell Size")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _cell_size { get; set; } = null;


        /// <summary>
        /// <para>Resampling Technique</para>
        /// <para><xdoc>
        ///   <para>Specifies the resampling technique to be used.</para>
        ///   <bulletList>
        ///     <bullet_item>Nearest— Nearest neighbor is the fastest resampling method; it minimizes changes to pixel values since no new values are created. It is suitable for discrete data, such as land cover.</bullet_item><para/>
        ///     <bullet_item>Bilinear— Bilinear interpolation calculates the value of each pixel by averaging (weighted for distance) the values of the surrounding four pixels. It is suitable for continuous data.</bullet_item><para/>
        ///     <bullet_item>Cubic— Cubic convolution calculates the value of each pixel by fitting a smooth curve based on the surrounding 16 pixels. This produces the smoothest image but can create values outside of the range found in the source data. It is suitable for continuous data.</bullet_item><para/>
        ///     <bullet_item>Majority—Majority resampling determines the value of each pixel based on the most popular value in a 3 by 3 window. Suitable for discrete data.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定要使用的重采样技术。</para>
        ///   <bulletList>
        ///     <bullet_item>最近 - 最近邻是最快的重采样方法;它最大限度地减少了对像素值的更改，因为不会创建新值。它适用于离散数据，例如土地覆盖。</bullet_item><para/>
        ///     <bullet_item>双线性 — 双线性插值通过对周围四个像素的值进行平均（按距离加权）来计算每个像素的值。它适用于连续数据。</bullet_item><para/>
        ///     <bullet_item>立方 — 三次卷积通过基于周围 16 个像素拟合平滑曲线来计算每个像素的值。这将生成最平滑的图像，但可能会创建源数据中查找范围之外的值。它适用于连续数据。</bullet_item><para/>
        ///     <bullet_item>多数 - 多数重采样根据 3 x 3 窗口中最常用的值确定每个像素的值。适用于离散数据。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Resampling Technique")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _resampling_type_value _resampling_type { get; set; } = _resampling_type_value._NEAREST;

        public enum _resampling_type_value
        {
            /// <summary>
            /// <para>Nearest</para>
            /// <para>Nearest— Nearest neighbor is the fastest resampling method; it minimizes changes to pixel values since no new values are created. It is suitable for discrete data, such as land cover.</para>
            /// <para>最近 - 最近邻是最快的重采样方法;它最大限度地减少了对像素值的更改，因为不会创建新值。它适用于离散数据，例如土地覆盖。</para>
            /// </summary>
            [Description("Nearest")]
            [GPEnumValue("NEAREST")]
            _NEAREST,

            /// <summary>
            /// <para>Bilinear</para>
            /// <para>Bilinear— Bilinear interpolation calculates the value of each pixel by averaging (weighted for distance) the values of the surrounding four pixels. It is suitable for continuous data.</para>
            /// <para>双线性 — 双线性插值通过对周围四个像素的值进行平均（按距离加权）来计算每个像素的值。它适用于连续数据。</para>
            /// </summary>
            [Description("Bilinear")]
            [GPEnumValue("BILINEAR")]
            _BILINEAR,

            /// <summary>
            /// <para>Cubic</para>
            /// <para>Cubic— Cubic convolution calculates the value of each pixel by fitting a smooth curve based on the surrounding 16 pixels. This produces the smoothest image but can create values outside of the range found in the source data. It is suitable for continuous data.</para>
            /// <para>立方 — 三次卷积通过基于周围 16 个像素拟合平滑曲线来计算每个像素的值。这将生成最平滑的图像，但可能会创建源数据中查找范围之外的值。它适用于连续数据。</para>
            /// </summary>
            [Description("Cubic")]
            [GPEnumValue("CUBIC")]
            _CUBIC,

            /// <summary>
            /// <para>Majority</para>
            /// <para>Majority—Majority resampling determines the value of each pixel based on the most popular value in a 3 by 3 window. Suitable for discrete data.</para>
            /// <para>多数 - 多数重采样根据 3 x 3 窗口中最常用的值确定每个像素的值。适用于离散数据。</para>
            /// </summary>
            [Description("Majority")]
            [GPEnumValue("MAJORITY")]
            _MAJORITY,

        }

        public Resample SetEnv(object compression = null, object configKeyword = null, object extent = null, object geographicTransformations = null, object nodata = null, object outputCoordinateSystem = null, object parallelProcessingFactor = null, object pyramid = null, object rasterStatistics = null, object resamplingMethod = null, object scratchWorkspace = null, object snapRaster = null, double[] tileSize = null, object workspace = null)
        {
            base.SetEnv(compression: compression, configKeyword: configKeyword, extent: extent, geographicTransformations: geographicTransformations, nodata: nodata, outputCoordinateSystem: outputCoordinateSystem, parallelProcessingFactor: parallelProcessingFactor, pyramid: pyramid, rasterStatistics: rasterStatistics, resamplingMethod: resamplingMethod, scratchWorkspace: scratchWorkspace, snapRaster: snapRaster, tileSize: tileSize, workspace: workspace);
            return this;
        }

    }

}